export const vSet = (Vue, keyAsStr) => (state, path, v) => {
    let curr = state, end = path.length - 1
    for (let i=0; i < end; i++) {
        let p = path[i]
        if (!curr[p]) {
            Vue.set(curr, p, !keyAsStr && typeof p === 'number' ? [] : {})
        }
        curr = curr[p]
    }
    Vue.set(curr, path[end], v)
}